home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Clipboard / ScrapWriter.h < prev   
Text File  |  2000-06-23  |  744b  |  44 lines

  1. // ScrapWriter.h
  2.  
  3. #ifndef ScrapWriter_h
  4. #define ScrapWriter_h
  5.  
  6. #ifndef ScrapType_h
  7. #include "ScrapType.h"
  8. #endif
  9. #ifndef ConstData_h
  10. #include "ConstData.h"
  11. #endif
  12.  
  13. class ScrapWriter
  14.   {
  15.     friend class Clipboard;
  16.     friend class GlobalCutter;
  17.     
  18.     private:
  19.         bool approved;
  20.         
  21.         // not implemented:
  22.             ScrapWriter( const ScrapWriter& );
  23.             void operator=( const ScrapWriter& );
  24.     
  25.         static void ThrowError( int32 error );
  26.  
  27.         ScrapWriter();
  28.         
  29.     public:
  30.         ~ScrapWriter();
  31.  
  32.         void Write( ScrapType, ConstData );
  33.         
  34.         void Approve()            { approved = true; }
  35.             /*
  36.                 If a change is not approved,
  37.                 the scrap will be cleared and left invalid.
  38.                 Thus if an exception is thrown before approval,
  39.                 incomplete data won't be propagated.
  40.             */
  41.   };
  42.  
  43. #endif
  44.